import {AddMenu} from "../../api/menuApi";

const menu = {
    actions:{
        addMenuAction({commit}, menuInfo) {
            const {menuTitle, menuIcon, childrenMenuTitle, childrenMenuIcon, childrenMenuPath} = menuInfo;
            return new Promise((resolve, reject) => {
                AddMenu(menuInfo).then(res => {
                    console.log(res);
                    resolve();
                }).catch(err => {
                    console.log(err)
                    reject();
                })
            })
        }
    }
}

export default menu